<?php

/*

Safety Box (safety_box.php)

*/

$page_title = "Safety Box";
$rank_check = 1;
include "header.inc.php";

print "$openHTML";

ECHO <<<END

<p align=center><a href=item_helper.php?game=$game>Item Helper</A> | <a href=myitems.php?game=$game>My Items</a> | <a href=myshop.php?game=$game>My Shop</a> | <a href=battle_items.php?game=$game>Equipped Items</a> | <a href=safety_box.php?game=$game>Safety Box</a></p>

<form action=safety_box.pro.php?game=$game method=post>
<CENTER><FONT SIZE="-1"><B>You have $sum_items2[stock]
items in stock, with a max of $max_stock.</B></FONT>

<P><FONT SIZE="-1"><TABLE CELLSPACING=1 CELLPADDING=0 WIDTH="95%" BGCOLOR="$topAndBottomBG">
   <TR BGCOLOR="$topAndBottomBG">
      <TD COLSPAN=6 HEIGHT=45>
         <CENTER><FONT SIZE="+2" COLOR="$topAndBottomText">--My
         Safety Box--</FONT></CENTER>
      </TD>
   </TR><form action=safetybox.pro.php?game=$game method=post>
   <TR BGCOLOR="$topAndBottomBG">
      <TD WIDTH=85>
         <CENTER><FONT SIZE="-1">Image</FONT></CENTER>
      </TD>
      <TD WIDTH=90>
         <CENTER><FONT SIZE="-1">Name</FONT></CENTER>
      </TD>
      <TD WIDTH=45>
         <CENTER><FONT SIZE="-1">Stock</FONT></CENTER>
      </TD>
      <TD WIDTH=55>
         <CENTER><FONT SIZE="-1">Value</FONT></CENTER>
      </TD>
      <TD>
         <CENTER><FONT SIZE="-1">Descrition</FONT></CENTER>
      </TD>
      <TD WIDTH=100>
         <CENTER><FONT SIZE="-1">Remove</FONT></CENTER>
      </TD>
   </TR>

END;

$find_items2 = mysql_query("SELECT * FROM safety_box WHERE owner = '$userid' AND game = '$game' ORDER BY item_id");

$z = 1;

while ($find_items = mysql_fetch_array($find_items2))
{
	$find_item2 = mysql_fetch_array(mysql_query("SELECT * FROM items2 WHERE id = 	'$find_items[item_id]' AND game = '$game'"));
	$id = $find_items[id];

	print "<TR BGCOLOR=\"$maincellColor\">
      <TD WIDTH=85>
         <CENTER><IMG SRC=\"images/user_images/opg_$game/items/item_$find_item2[id].gif\"></CENTER>
      </TD>
      <TD WIDTH=90>
         <CENTER><FONT SIZE=\"-1\"><B>$find_item2[item_name]</B></FONT><BR>
         </CENTER>
      </TD>
      <TD WIDTH=45>
         <CENTER><FONT SIZE=\"-1\">$find_items[stock]</FONT></CENTER>
      </TD>
      <TD WIDTH=55>
         <CENTER><FONT SIZE=\"-1\">$find_item2[item_value]</FONT></CENTER>
      </TD>
      <TD>
         <P><FONT SIZE=\"-1\">$find_item2[item_desc]</FONT></P>
      </TD>
      <TD WIDTH=100>
         <CENTER><FONT SIZE=\"-1\">Remove:
         <INPUT TYPE=text NAME=\"remove[$id]\" VALUE=\"0\" SIZE=7 MAXLENGTH=6><BR>
         item(s)</FONT></CENTER>
      </TD>
   </TR>";
}

ECHO <<<ENDED
</TABLE>
 <INPUT TYPE=submit NAME=Submit VALUE="Update" stock></FONT></P></CENTER></form>
ENDED;

print "$closeHTML";
?>